package com.wcf.controller;

import com.wcf.model.User;
import com.wcf.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * Created by hadoop on 2016/1/9.
 */
@Controller()
public class UserController {
    @Autowired
    private IUserService userService;

    @RequestMapping("/user/list")
    public String listAllUser(ModelMap modelMap){
        List<User> userlist = this.userService.findAllUser();
        modelMap.addAttribute("users",userlist);
        return "user_list";
    }
}
